package com.deyuanyun.pic.risk.controller;

import com.deyuanyun.pic.common.util.ajax.AjaxSupport;
import com.deyuanyun.pic.settings.support.biz.CodeUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 风险评价 控制跳转类
 *
 * @author huanglw
 * @date
 *
 * History: [修改人][时间][修改描述]
 */
@Controller
@RequestMapping("/riskMgr/comm")
public class RiskMgrController {

	/**
	 * 得到 评价时间
	 */
	@RequestMapping("/queryYears.json")
	@ResponseBody
	public void queryYears() {
		AjaxSupport.sendSuccessText("success", CodeUtil.getCodeList("COMM_YEAR", Short.valueOf("1")));
	}

	/**
	 * 得到 风险等级
	 */
	@RequestMapping("/queryRiskGrade.json")
    @ResponseBody
	public void queryRiskGrade() {
		AjaxSupport.sendSuccessText("success", CodeUtil.getCodeList("RA_RISK_GRADE"));
	}

	/**
	 * 得到 主要威胁因素
	 */
	@RequestMapping("/queryMainThreats.json")
    @ResponseBody
	public void queryMainThreats() {
		AjaxSupport.sendSuccessText("success", CodeUtil.getCodeList("RA_MAIN_THREATS"));
	}

	/**
	 *  根据 码表类型，得到码表对应的list
	 */
	@RequestMapping("/queryCode/{type}.json")
    @ResponseBody
	public void queryRiskGrade(@PathVariable String type) {
		AjaxSupport.sendSuccessText("success", CodeUtil.getCodeList(type, Short.valueOf("1")));
	}

}
